<!--
 * @Author: ChunLai
 * @Date: 2023-03-31 19:35:07
 * @LastEditTime: 2024-09-25 15:34:45
 * @Description: 业务员信息卡片
 * @FilePath: \01.latest-short-insure\src\views\multipages\components\ClerkInfoCard.vue
-->
<template>
  <div class="card_main_box">
    <div class="flex agent-infos">
      <span class="avtor_img">
        <img
          :src="itemObj.jobImg || require(`${imgUrlPath}/icons/avtor.png`)"
          alt=""
        />
      </span>
      <div class="agt-box">
        <p class="agt-name">
          {{ itemObj.name }}
        </p>
        <p class="agt-num">执业证：{{ itemObj.certificate }}</p>
      </div>
    </div>
    <div class="agt_tags">
      <div class="tag-box">
        <p class="tag_value">
          {{ itemObj.chatNum == "0" ? `空闲中` : `排队${itemObj.chatNum}人` }}
        </p>
        <p class="tag_label">接单状态</p>
      </div>
      <div class="tag-box">
        <p class="tag_value">
          {{
            itemObj.serverUserNum == "0" ? `暂无` : `${itemObj.serverUserNum}人`
          }}
        </p>
        <p class="tag_label">服务客户</p>
      </div>
      <div class="tag-box">
        <p class="tag_value">{{ itemObj.entryYear }}年</p>
        <p class="tag_label">从业经验</p>
      </div>
    </div>
    <div class="card-md3">
      <div class="bg1_icon">执业区域:{{ itemObj.provinceName }}</div>
      <div class="bg2_icon" @click="tuijianHandle">推荐TA</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ClerkInfoCard",
  props: {
    itemObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  components: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    // 推荐--->跳转客服海报页
    tuijianHandle() {
      // 推广员没有执业证,禁止推广
      if (!this.itemObj.certificate) {
        this.$baseToast("推广员没有执业证,禁止推广,请确认");
        return;
      }
      let postUrl = `/poster?clerkWorkNum=${this.itemObj.workNum}`;
      if (this.itemObj.kfid) {
        postUrl += `&kfid=${this.itemObj.kfid}`;
      }
      this.$router.push(`${postUrl}`);
    },
  },
};
</script>

<style lang="less" scoped>
.card_main_box {
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  background-color: #fff;
  padding: 22px 15px;
  padding-bottom: 40px;
  position: relative;
  margin-bottom: 10px;
}

.agt-box {
  margin-left: 10px;
}

.agt-name {
  font-size: 18px;
  font-weight: bold;
  color: #1b1b1b;
}

.agt-num {
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  margin-top: 4px;
}

.agt_tags {
  display: flex;
  margin-top: 10px;
}

.tag-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 33%;
  height: 60px;
}

.tag_value {
  font-size: 15px;
  font-weight: bold;
  color: #1b1b1b;
}

.tag_label {
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  margin-top: 7px;
}

.card-md3 {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 30px;
}

.bg1_icon {
  width: 250px;
  height: 30px;
  line-height: 30px;
  padding-left: 25px;
  color: #ffffff;
  background: url("//wxou.mschn.cn/app_h5/insurepics/icons/card_bg1.png") no-repeat;
  background-size: 100% 100%;
}

.bg2_icon {
  width: 95px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  padding-left: 5px;
  color: #ffffff;
  background: url("//wxou.mschn.cn/app_h5/insurepics/icons/card_bg2.png") no-repeat;
  background-size: 100% 100%;
}

.avtor_img {
  display: inline-block;
  width: 44px;
  height: 44px;
  border-radius: 100%;
  overflow: hidden;
}
</style>
